;solution for euler56

(defun digital-sum (n)
	(let ((sum 0))
		(loop
			(when (= n 0) (return))
			(incf sum (mod n 10))
			(setf n (floor (/ n 10))))
		(return-from digital-sum sum)))
		
(defun solve-euler56 ()
	(let ((maxsum 0) (cursum 0))
		(dotimes (a 101)
			(dotimes (b 101)
				(setf cursum (digital-sum (expt a b)))
				(when (> cursum maxsum) (setf maxsum cursum))))
		(format t "Euler 56:~a" maxsum)))